#!/usr/bin/env bash
port=3999

export PATH=node_modules/.bin:"$PATH"

coffee test/server.coffee $port &
pid=$!

terminate_test_server() {
  kill $pid
}
trap terminate_test_server EXIT

phantomjs --disk-cache=true \
  test/runner.coffee "http://localhost:${port}/" "$@" \
  2> >(grep -v "CoreText performance note" >&2)

exit $?
